package com.gateway.common.enums;

/**
 * @program: api-gateway
 * @description:
 * @author: YuKai Fan
 * @create: 2025/2/5 20:18
 **/
public enum GatewayRetCodeEnum implements ErrorCode {

    SUCCESS(0, "success"),
    SERVER_ERROR(500, "服务出错了"),
    TOKEN_ERROR(401, "token异常"),

    /**
     * api meta
     */
    API_NOT_EXISTED(400, "接口不存在"),
    API_BANNED(400, "接口已被禁用"),
    API_OFFLINE(400, "接口已下线"),

    /**
     * 请求
     */
    REQUEST_HEADER_MODIFIED(400, "请求头数据[%s]被修改"),
    ;

    private final Integer code;

    private final String message;

    GatewayRetCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
